const { createProxyMiddleware } = require('http-proxy-middleware');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = function(app) {
  devtool: 'none',
  app.use(
    createProxyMiddleware('/portal', {
      target: 'http://123.test.com',
      changeOrigin: true,
      // pathRewrite: {
      //   '^/portal': ''
      // }
    })
  )
  plugins: [
      new UglifyJsPlugin({
        uglifyOptions: {
          compress: {
            drop_console: true, // 删除 console.log
          },
          output: {
            comments: false, // 删除注释
          },
        },
        sourceMap: true, // 生成 source map
      })
    ]
}